|
|
|
|
|
|
|
Figure 11.18
Two Bezier curves meeting smoothly at a common point |
|
|
|
|
|
|
|
|
Figure 11.18 shows two Bezier curves meeting smoothly at a common point. The curves' control points are labeled p11, p12 and so forth. The curves are connected because p14 = p21. They meet smoothly because the tangent vectors (p14 p13) = (p22 p21 ) * 1/3. |
|
|
|
|
|
|
|
|
Higher-Order Bezier Curves |
|
|
|
|
|
|
|
|
By properly arranging the control points that define a sequence of Bezier curves, you can create a series of curves that connect many different points smoothly. Instead of using a sequence of curves to fit a series of points, you can use more general blending functions to create a single higher-order Bezier curve that connects many data points. |
|
|
|
|
|
|
|
|
Suppose you have N + 1 control points with coordinates (x0, y0) (x1, y1), . . . , (xN, yN). Then you can write the equation for the X coordinate of a Bezier curve as : |
|
|
|
 |
|
|
|
|
X(t) = S xi * Bi,N(t) |
|
|
|
|
|
|
|
|
Here Bi,N(t) is the blending function : |
|
|
|
 |
|
|
|
|
Bi,N(t) = ti * (1 - t)N-i * N! / i! / (N - i)! |
|
|
|
|
|
|
|
|
The Bezier curves in the previous section used four data points: two endpoints and two additional control points. In that case N = 3, so the blending functions are: |
|
|
|
 |
|
|
|
|
B0,3(t) = t0 * (1 - t)3-0 * 3! / 0! / (3 - 0)!
= (1 - t)3 = -t3 + 3 * t2 - 3 * t + 1
B1,3(t) =t1 * (1 - t)3-1 * 3! / 1! / (3 - 1)!
= t * (1 - t)2 * 6 / 2
= 3 * t3 - 6 * t2 + 3 * t
B2,3(t) = t2 * (1 - t) 3-2 * 3! / 2! / (3 - 2)!
= t2 * (1 - t) * 6 / 2
= -3 * t3 + 3 * t2 B3,3(t) = t3 * (1 - t) 3-3 * 3! / 3!/ (3 - 3)!
= t3 |
|
|
|
|
|